package task1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 东莞呵呵
 * Date:2022-05-10
 * Time:16:59
 */
public class TestDemo5 {
    public static boolean isOrderly(int[] arr){
        for (int i = 0; i < arr.length-1; i++) {
            if(arr[i]>arr[i+1]){
                return false;
            }
        }
        return true;
    }
    public static void main(String[] args) {
        int[] numS={1,2,3,4,5,7,6,7};
        boolean ret=isOrderly(numS);
        if(!ret){
            System.out.println("不是有序数组");
        }else{
            System.out.println("有序数组");
        }
    }
}
